
const dictionary = {
  state: {
    dictList: []
  },

  mutations: {
    SET_DICT_LIST: (state, obj) => {
      state.dictList[obj.key] = obj.value
    },
    REMOVE_DICT_LIST (state) {
      state.dictList = []
    }
  },
  actions: {
    GenerateDict ({
      commit
    }, data) {
      return new Promise(resolve => {
        commit('SET_DICT_LIST', data)
        resolve()
      })
    },
    RefreshDict ({
      commit
    }) {
      return new Promise(resolve => {
        commit('REMOVE_DICT_LIST')
        resolve()
      })
    }
  }
}

export default dictionary
